/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.etecmatao.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author admin
 */
@Entity
@Table(name = "fotos")
@NamedQueries({
    @NamedQuery(name = "Fotos.findAll", query = "SELECT f FROM Fotos f"),
    @NamedQuery(name = "Fotos.findByIdFotos", query = "SELECT f FROM Fotos f WHERE f.idFotos = :idFotos"),
    @NamedQuery(name = "Fotos.findByDescricao", query = "SELECT f FROM Fotos f WHERE f.descricao = :descricao"),
    @NamedQuery(name = "Fotos.findByData", query = "SELECT f FROM Fotos f WHERE f.data = :data"),
    @NamedQuery(name = "Fotos.findByStatus", query = "SELECT f FROM Fotos f WHERE f.status = :status")})
public class Fotos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_Fotos")
    private Integer idFotos;
    @Basic(optional = false)
    @Column(name = "descricao")
    private String descricao;
    @Basic(optional = false)
    @Column(name = "data")
    @Temporal(TemporalType.DATE)
    private Date data;
    @Basic(optional = false)
    @Lob
    @Column(name = "imagem")
    private byte[] imagem;
    @Basic(optional = false)
    @Column(name = "status")
    private String status;
    @JoinColumn(name = "email", referencedColumnName = "email")
    @ManyToOne(optional = false)
    private Login login;
    @JoinColumn(name = "id_Albuns", referencedColumnName = "id_Albuns")
    @ManyToOne(optional = false)
    private Albuns albuns;

    public Fotos() {
    }

    public Fotos(Integer idFotos) {
        this.idFotos = idFotos;
    }

    public Fotos(Integer idFotos, String descricao, Date data, byte[] imagem, String status) {
        this.idFotos = idFotos;
        this.descricao = descricao;
        this.data = data;
        this.imagem = imagem;
        this.status = status;
    }

    public Integer getIdFotos() {
        return idFotos;
    }

    public void setIdFotos(Integer idFotos) {
        this.idFotos = idFotos;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public Date getData() {
        return data;
    }

    public void setData(Date data) {
        this.data = data;
    }

    public byte[] getImagem() {
        return imagem;
    }

    public void setImagem(byte[] imagem) {
        this.imagem = imagem;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Login getLogin() {
        return login;
    }

    public void setLogin(Login login) {
        this.login = login;
    }

    public Albuns getAlbuns() {
        return albuns;
    }

    public void setAlbuns(Albuns albuns) {
        this.albuns = albuns;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idFotos != null ? idFotos.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Fotos)) {
            return false;
        }
        Fotos other = (Fotos) object;
        if ((this.idFotos == null && other.idFotos != null) || (this.idFotos != null && !this.idFotos.equals(other.idFotos))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "admin.model.Fotos[idFotos=" + idFotos + "]";
    }

}
